package org.study.data.migration.boot.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.*;

/**
 * 数据查询、插入 Mapper 接口
 *
 * @author doveylovey
 * @version v1.0.0
 * @email 1135782208@qq.com
 * @date 2025年03月04日
 */
@Mapper
public interface DataMapper {
    @DS("source")
    List<Map<String, Object>> selectDataFromSource(@Param("tableName") String tableName);

    @DS("source")
    List<Map<String, Object>> selectDataFromSource2(@Param("tableName") String tableName, @Param("columns") List<String> columnList);

    @DS("target")
    int insertDataIntoTarget(@Param("tableName") String tableName, @Param("data") TreeMap<String, Object> data);

    @DS("target")
    int insertDataIntoTarget2(@Param("tableName") String tableName, @Param("dataList") List<TreeMap<String, Object>> dataList);
}
